#include "BulletCollision/BroadphaseCollision/btDbvt.h"
#ifdef __cplusplus
extern "C" {
#endif
btDbvtNode* bullet_NewbtDbvtNode(){
	btDbvtNode* wrap_out = new btDbvtNode();
	return wrap_out;
}

btDbvtNode** bullet_btDbvtNode_GetFieldOfParent(btDbvtNode* c_this){
	return (btDbvtNode**)(&c_this->parent);
}

btDbvtAabbMm* bullet_btDbvtNode_GetFieldOfVolume(btDbvtNode* c_this){
	return (btDbvtAabbMm*)(&c_this->volume);
}

bool bullet_btDbvtNode_isinternal(btDbvtNode* c_this){
	bool c_out = c_this->isinternal();
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btDbvtNode_isleaf(btDbvtNode* c_this){
	bool c_out = c_this->isleaf();
	bool wrap_out = (c_out);
	return wrap_out;
}

btDbvtAabbMm* bullet_NewbtDbvtAabbMm(){
	btDbvtAabbMm* wrap_out = new btDbvtAabbMm();
	return wrap_out;
}

btVector3* bullet_btDbvtAabbMm_Center(btDbvtAabbMm* c_this){
	btVector3 c_out = c_this->Center();
	btVector3* wrap_out = new btVector3(c_out);
	return wrap_out;
}

int bullet_btDbvtAabbMm_Classify(btDbvtAabbMm* c_this,btVector3* n,double o,int s){
	btVector3 const& c_arg_n=(btVector3 const&)(*n);
	btScalar c_arg_o=o;
	int c_arg_s=s;
	int c_out = c_this->Classify(c_arg_n,c_arg_o,c_arg_s);
	int wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btDbvtAabbMm_Contain(btDbvtAabbMm* c_this,btDbvtAabbMm* a){
	btDbvtAabbMm const& c_arg_a=(btDbvtAabbMm const&)(*a);
	bool c_out = c_this->Contain(c_arg_a);
	bool wrap_out = (c_out);
	return wrap_out;
}

void bullet_btDbvtAabbMm_Expand(btDbvtAabbMm* c_this,btVector3* e){
	btVector3 const& c_arg_e=(btVector3 const&)(*e);
	c_this->Expand(c_arg_e);
}

btVector3* bullet_btDbvtAabbMm_Extents(btDbvtAabbMm* c_this){
	btVector3 c_out = c_this->Extents();
	btVector3* wrap_out = new btVector3(c_out);
	return wrap_out;
}

btDbvtAabbMm* bullet_btDbvtAabbMm_FromCE(btDbvtAabbMm* c_this,btVector3* c,btVector3* e){
	btVector3 const& c_arg_c=(btVector3 const&)(*c);
	btVector3 const& c_arg_e=(btVector3 const&)(*e);
	btDbvtAabbMm c_out = c_this->FromCE(c_arg_c,c_arg_e);
	btDbvtAabbMm* wrap_out = new btDbvtAabbMm(c_out);
	return wrap_out;
}

btDbvtAabbMm* bullet_btDbvtAabbMm_FromCR(btDbvtAabbMm* c_this,btVector3* c,double r){
	btVector3 const& c_arg_c=(btVector3 const&)(*c);
	btScalar c_arg_r=r;
	btDbvtAabbMm c_out = c_this->FromCR(c_arg_c,c_arg_r);
	btDbvtAabbMm* wrap_out = new btDbvtAabbMm(c_out);
	return wrap_out;
}

btDbvtAabbMm* bullet_btDbvtAabbMm_FromMM(btDbvtAabbMm* c_this,btVector3* mi,btVector3* mx){
	btVector3 const& c_arg_mi=(btVector3 const&)(*mi);
	btVector3 const& c_arg_mx=(btVector3 const&)(*mx);
	btDbvtAabbMm c_out = c_this->FromMM(c_arg_mi,c_arg_mx);
	btDbvtAabbMm* wrap_out = new btDbvtAabbMm(c_out);
	return wrap_out;
}

btDbvtAabbMm* bullet_btDbvtAabbMm_FromPoints(btDbvtAabbMm* c_this,btVector3* pts,int n){
	btVector3 const * c_arg_pts=(btVector3 const *)(void*)(pts);
	int c_arg_n=n;
	btDbvtAabbMm c_out = c_this->FromPoints(c_arg_pts,c_arg_n);
	btDbvtAabbMm* wrap_out = new btDbvtAabbMm(c_out);
	return wrap_out;
}

btDbvtAabbMm* bullet_btDbvtAabbMm_FromPoints1(btDbvtAabbMm* c_this,btVector3** ppts,int n){
	btVector3 const * * c_arg_ppts=(btVector3 const * *)(void*)(ppts);
	int c_arg_n=n;
	btDbvtAabbMm c_out = c_this->FromPoints(c_arg_ppts,c_arg_n);
	btDbvtAabbMm* wrap_out = new btDbvtAabbMm(c_out);
	return wrap_out;
}

btVector3* bullet_btDbvtAabbMm_Lengths(btDbvtAabbMm* c_this){
	btVector3 c_out = c_this->Lengths();
	btVector3* wrap_out = new btVector3(c_out);
	return wrap_out;
}

btVector3* bullet_btDbvtAabbMm_Maxs(btDbvtAabbMm* c_this){
	btVector3 const& c_out = c_this->Maxs();
	btVector3* wrap_out = (btVector3*)(&c_out);
	return wrap_out;
}

btVector3* bullet_btDbvtAabbMm_Mins(btDbvtAabbMm* c_this){
	btVector3 const& c_out = c_this->Mins();
	btVector3* wrap_out = (btVector3*)(&c_out);
	return wrap_out;
}

double bullet_btDbvtAabbMm_ProjectMinimum(btDbvtAabbMm* c_this,btVector3* v,unsigned int signs){
	btVector3 const& c_arg_v=(btVector3 const&)(*v);
	unsigned int c_arg_signs=signs;
	btScalar c_out = c_this->ProjectMinimum(c_arg_v,c_arg_signs);
	double wrap_out = (c_out);
	return wrap_out;
}

void bullet_btDbvtAabbMm_SignedExpand(btDbvtAabbMm* c_this,btVector3* e){
	btVector3 const& c_arg_e=(btVector3 const&)(*e);
	c_this->SignedExpand(c_arg_e);
}

btVector3* bullet_btDbvtAabbMm_tMaxs(btDbvtAabbMm* c_this){
	btVector3& c_out = c_this->tMaxs();
	btVector3* wrap_out = (btVector3*)(&c_out);
	return wrap_out;
}

btVector3* bullet_btDbvtAabbMm_tMins(btDbvtAabbMm* c_this){
	btVector3& c_out = c_this->tMins();
	btVector3* wrap_out = (btVector3*)(&c_out);
	return wrap_out;
}

btDbvt::sStknNN* bullet_NewbtDbvtsStknNN(){
	btDbvt::sStknNN* wrap_out = new btDbvt::sStknNN();
	return wrap_out;
}

btDbvt::sStknNN* bullet_NewbtDbvtsStknNN1(btDbvntNode* na,btDbvntNode* nb){
	btDbvntNode const * c_arg_na=(btDbvntNode const *)(void*)(na);
	btDbvntNode const * c_arg_nb=(btDbvntNode const *)(void*)(nb);
	btDbvt::sStknNN* wrap_out = new btDbvt::sStknNN(c_arg_na,c_arg_nb);
	return wrap_out;
}

btDbvt::sStkNPS* bullet_NewbtDbvtsStkNPS(){
	btDbvt::sStkNPS* wrap_out = new btDbvt::sStkNPS();
	return wrap_out;
}

btDbvt::sStkNPS* bullet_NewbtDbvtsStkNPS1(btDbvtNode* n,unsigned int m,double v){
	btDbvtNode const * c_arg_n=(btDbvtNode const *)(void*)(n);
	unsigned int c_arg_m=m;
	btScalar c_arg_v=v;
	btDbvt::sStkNPS* wrap_out = new btDbvt::sStkNPS(c_arg_n,c_arg_m,c_arg_v);
	return wrap_out;
}

int bullet_btDbvtsStkNPS_GetFieldOfMask(btDbvt::sStkNPS* c_this){
	return (int)(c_this->mask);
}

double bullet_btDbvtsStkNPS_GetFieldOfValue(btDbvt::sStkNPS* c_this){
	return (double)(c_this->value);
}

btDbvt::sStkNP* bullet_NewbtDbvtsStkNP(btDbvtNode* n,unsigned int m){
	btDbvtNode const * c_arg_n=(btDbvtNode const *)(void*)(n);
	unsigned int c_arg_m=m;
	btDbvt::sStkNP* wrap_out = new btDbvt::sStkNP(c_arg_n,c_arg_m);
	return wrap_out;
}

int bullet_btDbvtsStkNP_GetFieldOfMask(btDbvt::sStkNP* c_this){
	return (int)(c_this->mask);
}

btDbvt::sStkNN* bullet_NewbtDbvtsStkNN(){
	btDbvt::sStkNN* wrap_out = new btDbvt::sStkNN();
	return wrap_out;
}

btDbvt::sStkNN* bullet_NewbtDbvtsStkNN1(btDbvtNode* na,btDbvtNode* nb){
	btDbvtNode const * c_arg_na=(btDbvtNode const *)(void*)(na);
	btDbvtNode const * c_arg_nb=(btDbvtNode const *)(void*)(nb);
	btDbvt::sStkNN* wrap_out = new btDbvt::sStkNN(c_arg_na,c_arg_nb);
	return wrap_out;
}

btDbvt::sStkCLN* bullet_NewbtDbvtsStkCLN(btDbvtNode* n,btDbvtNode* p){
	btDbvtNode const * c_arg_n=(btDbvtNode const *)(void*)(n);
	btDbvtNode * c_arg_p=(btDbvtNode *)(void*)(p);
	btDbvt::sStkCLN* wrap_out = new btDbvt::sStkCLN(c_arg_n,c_arg_p);
	return wrap_out;
}

btDbvt::ICollide* bullet_NewbtDbvtICollide(){
	btDbvt::ICollide* wrap_out = new btDbvt::ICollide();
	return wrap_out;
}

bool bullet_btDbvtICollide_AllLeaves(btDbvt::ICollide* c_this,btDbvtNode* tmp_arg0){
	btDbvtNode const * c_arg_tmp_arg0=(btDbvtNode const *)(void*)(tmp_arg0);
	bool c_out = c_this->AllLeaves(c_arg_tmp_arg0);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btDbvtICollide_Descent(btDbvt::ICollide* c_this,btDbvtNode* tmp_arg0){
	btDbvtNode const * c_arg_tmp_arg0=(btDbvtNode const *)(void*)(tmp_arg0);
	bool c_out = c_this->Descent(c_arg_tmp_arg0);
	bool wrap_out = (c_out);
	return wrap_out;
}

void bullet_btDbvtICollide_Process(btDbvt::ICollide* c_this,btDbvtNode* tmp_arg0,btDbvtNode* tmp_arg1){
	btDbvtNode const * c_arg_tmp_arg0=(btDbvtNode const *)(void*)(tmp_arg0);
	btDbvtNode const * c_arg_tmp_arg1=(btDbvtNode const *)(void*)(tmp_arg1);
	c_this->Process(c_arg_tmp_arg0,c_arg_tmp_arg1);
}

void bullet_btDbvtICollide_Process1(btDbvt::ICollide* c_this,btDbvtNode* tmp_arg0){
	btDbvtNode const * c_arg_tmp_arg0=(btDbvtNode const *)(void*)(tmp_arg0);
	c_this->Process(c_arg_tmp_arg0);
}

void bullet_btDbvtICollide_Process2(btDbvt::ICollide* c_this,btDbvtNode* n,double tmp_arg1){
	btDbvtNode const * c_arg_n=(btDbvtNode const *)(void*)(n);
	btScalar c_arg_tmp_arg1=tmp_arg1;
	c_this->Process(c_arg_n,c_arg_tmp_arg1);
}

void bullet_btDbvtICollide_Process3(btDbvt::ICollide* c_this,btDbvntNode* tmp_arg0,btDbvntNode* tmp_arg1){
	btDbvntNode const * c_arg_tmp_arg0=(btDbvntNode const *)(void*)(tmp_arg0);
	btDbvntNode const * c_arg_tmp_arg1=(btDbvntNode const *)(void*)(tmp_arg1);
	c_this->Process(c_arg_tmp_arg0,c_arg_tmp_arg1);
}

btDbvt::IClone* bullet_NewbtDbvtIClone(){
	btDbvt::IClone* wrap_out = new btDbvt::IClone();
	return wrap_out;
}

btDbvt* bullet_NewbtDbvt(){
	btDbvt* wrap_out = new btDbvt();
	return wrap_out;
}

void bullet_btDbvt_benchmark(btDbvt* c_this){
	c_this->benchmark();
}

void bullet_btDbvt_clear(btDbvt* c_this){
	c_this->clear();
}

void bullet_btDbvt_clone(btDbvt* c_this,btDbvt* dest,btDbvt::IClone* iclone){
	btDbvt& c_arg_dest=(btDbvt&)(*dest);
	btDbvt::IClone * c_arg_iclone=(btDbvt::IClone *)(void*)(iclone);
	c_this->clone(c_arg_dest,c_arg_iclone);
}

int bullet_btDbvt_countLeaves(btDbvt* c_this,btDbvtNode* node){
	btDbvtNode const * c_arg_node=(btDbvtNode const *)(void*)(node);
	int c_out = c_this->countLeaves(c_arg_node);
	int wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btDbvt_empty(btDbvt* c_this){
	bool c_out = c_this->empty();
	bool wrap_out = (c_out);
	return wrap_out;
}

int bullet_btDbvt_GetFieldOfM_leaves(btDbvt* c_this){
	return (int)(c_this->m_leaves);
}

int bullet_btDbvt_GetFieldOfM_lkhd(btDbvt* c_this){
	return (int)(c_this->m_lkhd);
}

unsigned int bullet_btDbvt_GetFieldOfM_opath(btDbvt* c_this){
	return (unsigned int)(c_this->m_opath);
}

int bullet_btDbvt_maxdepth(btDbvt* c_this,btDbvtNode* node){
	btDbvtNode const * c_arg_node=(btDbvtNode const *)(void*)(node);
	int c_out = c_this->maxdepth(c_arg_node);
	int wrap_out = (c_out);
	return wrap_out;
}

int bullet_btDbvt_nearest(btDbvt* c_this,int* i,btDbvt::sStkNPS* a,double v,int l,int h){
	int const * c_arg_i=(int const *)(void*)(i);
	btDbvt::sStkNPS const * c_arg_a=(btDbvt::sStkNPS const *)(void*)(a);
	btScalar c_arg_v=v;
	int c_arg_l=l;
	int c_arg_h=h;
	int c_out = c_this->nearest(c_arg_i,c_arg_a,c_arg_v,c_arg_l,c_arg_h);
	int wrap_out = (c_out);
	return wrap_out;
}

void bullet_btDbvt_optimizeBottomUp(btDbvt* c_this){
	c_this->optimizeBottomUp();
}

void bullet_btDbvt_optimizeIncremental(btDbvt* c_this,int passes){
	int c_arg_passes=passes;
	c_this->optimizeIncremental(c_arg_passes);
}

void bullet_btDbvt_optimizeTopDown(btDbvt* c_this,int bu_treshold){
	int c_arg_bu_treshold=bu_treshold;
	c_this->optimizeTopDown(c_arg_bu_treshold);
}

void bullet_btDbvt_remove(btDbvt* c_this,btDbvtNode* leaf){
	btDbvtNode * c_arg_leaf=(btDbvtNode *)(void*)(leaf);
	c_this->remove(c_arg_leaf);
}

void bullet_btDbvt_update(btDbvt* c_this,btDbvtNode* leaf,int lookahead){
	btDbvtNode * c_arg_leaf=(btDbvtNode *)(void*)(leaf);
	int c_arg_lookahead=lookahead;
	c_this->update(c_arg_leaf,c_arg_lookahead);
}

void bullet_btDbvt_update1(btDbvt* c_this,btDbvtNode* leaf,btDbvtAabbMm* volume){
	btDbvtNode * c_arg_leaf=(btDbvtNode *)(void*)(leaf);
	btDbvtAabbMm& c_arg_volume=(btDbvtAabbMm&)(*volume);
	c_this->update(c_arg_leaf,c_arg_volume);
}

bool bullet_btDbvt_update2(btDbvt* c_this,btDbvtNode* leaf,btDbvtAabbMm* volume,btVector3* velocity,double margin){
	btDbvtNode * c_arg_leaf=(btDbvtNode *)(void*)(leaf);
	btDbvtAabbMm& c_arg_volume=(btDbvtAabbMm&)(*volume);
	btVector3 const& c_arg_velocity=(btVector3 const&)(*velocity);
	btScalar c_arg_margin=margin;
	bool c_out = c_this->update(c_arg_leaf,c_arg_volume,c_arg_velocity,c_arg_margin);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btDbvt_update3(btDbvt* c_this,btDbvtNode* leaf,btDbvtAabbMm* volume,btVector3* velocity){
	btDbvtNode * c_arg_leaf=(btDbvtNode *)(void*)(leaf);
	btDbvtAabbMm& c_arg_volume=(btDbvtAabbMm&)(*volume);
	btVector3 const& c_arg_velocity=(btVector3 const&)(*velocity);
	bool c_out = c_this->update(c_arg_leaf,c_arg_volume,c_arg_velocity);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btDbvt_update4(btDbvt* c_this,btDbvtNode* leaf,btDbvtAabbMm* volume,double margin){
	btDbvtNode * c_arg_leaf=(btDbvtNode *)(void*)(leaf);
	btDbvtAabbMm& c_arg_volume=(btDbvtAabbMm&)(*volume);
	btScalar c_arg_margin=margin;
	bool c_out = c_this->update(c_arg_leaf,c_arg_volume,c_arg_margin);
	bool wrap_out = (c_out);
	return wrap_out;
}

void bullet_btDbvt_write(btDbvt* c_this,btDbvt::IWriter* iwriter){
	btDbvt::IWriter * c_arg_iwriter=(btDbvt::IWriter *)(void*)(iwriter);
	c_this->write(c_arg_iwriter);
}

btDbvntNode* bullet_NewbtDbvntNode(btDbvtNode* n){
	btDbvtNode const * c_arg_n=(btDbvtNode const *)(void*)(n);
	btDbvntNode* wrap_out = new btDbvntNode(c_arg_n);
	return wrap_out;
}

double bullet_btDbvntNode_GetFieldOfAngle(btDbvntNode* c_this){
	return (double)(c_this->angle);
}

void** bullet_btDbvntNode_GetFieldOfData(btDbvntNode* c_this){
	return (void**)(&c_this->data);
}

btVector3* bullet_btDbvntNode_GetFieldOfNormal(btDbvntNode* c_this){
	return (btVector3*)(&c_this->normal);
}

btDbvtAabbMm* bullet_btDbvntNode_GetFieldOfVolume(btDbvntNode* c_this){
	return (btDbvtAabbMm*)(&c_this->volume);
}

bool bullet_btDbvntNode_isinternal(btDbvntNode* c_this){
	bool c_out = c_this->isinternal();
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btDbvntNode_isleaf(btDbvntNode* c_this){
	bool c_out = c_this->isleaf();
	bool wrap_out = (c_out);
	return wrap_out;
}

#ifdef __cplusplus
}
#endif
